#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>

int main(int argc, char** argv)
{
    if (argc != 2)
    {
        std::cerr << "Usage: " << argv[0] << " <pcd_file_path>" << std::endl;
        return 1;
    }

    std::string map_file = argv[1];
    pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);

    std::cout << "Attempting to load map from: " << map_file << std::endl;

    if (pcl::io::loadPCDFile<pcl::PointXYZ>(map_file, *cloud) == -1)
    {
        std::cerr << "Failed to load map from " << map_file << std::endl;
        return 1;
    }

    std::cout << "Map loaded successfully from " << map_file << std::endl;
    std::cout << "Map size: " << cloud->size() << " points" << std::endl;

    return 0;
} 